{% extends "pretixpresale/base.html" %}
{% load i18n %}
{% load static %}
{% load thumb %}
{% load eventurl %}
{% load safelink %}
{% load rich_text %}
{% load compress %}
{% block thetitle %}
    {% if messages %}
        {{ messages|join:" " }} :: 
    {% endif %}
    {% block title %}{% endblock %}{% if request.resolver_match.url_name != "event.index" %} :: {% endif %}{{ event.name }}
{% endblock %}
{% block custom_header %}
    {% if event.settings.meta_noindex %}
        <meta name="robots" content="noindex, nofollow">
    {% endif %}
    <meta property="og:type" content="website" />
    {% if social_image %}
        <meta property="og:image" content="{{ social_image }}" />
    {% endif %}
    {{ block.super }}
{% endblock %}
{% block above %}
    {{ request.organizer.slug|json_script:"organizer_name" }}
    {% if not event.live %}
        <div class="offline-banner {% if event.settings.logo_image %}offline-banner-absolute{% endif %}">
            <div class="container">
                <span class="fa fa-user-secret" aria-hidden="true"></span>
                {% trans "This shop is currently only visible to you and your team." %}
                <a href='{% url "control:event.live" event=event.slug organizer=event.organizer.slug %}'>
                    {% trans "Take it live now" %}
                </a>
            </div>
        </div>
    {% endif %}
    {% if event.settings.event_logo_image %}
        <div class="event-logo-img-placement">
            <img src="{{ event.settings.event_logo_image.url }}" alt="{% translate 'Event logo' %}" class="img-fluid event-logo-image">
        </div>
    {% endif %}
    <div class="container page-header-links {% if event.settings.theme_color_background|upper != "#FFFFFF" or event.settings.logo_image_large %}page-header-links-outside{% endif %}">
        {% if event.settings.theme_color_background|upper != "#FFFFFF" or event.settings.logo_image_large %}
            <div class="pull-right header-part flip hidden-print header-content">
                <nav class="locales" aria-label="{% trans "select language" %}">
                    {% if event.settings.locales|length > 1 %}
                        {% for l in languages %}
                            <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}{% if request.META.QUERY_STRING %}%3F{{ request.META.QUERY_STRING|urlencode }}{% endif %}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow" lang="{{ l.code }}" hreflang="{{ l.code }}">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    {% endif %}
                </nav>
                {% include "pretixpresale/fragment_login_status.html" %}
            </div>
        {% endif %}
        {% if request.event.settings.organizer_link_back %}
            <div class="pull-left header-part flip hidden-print">
                <a href="{% eventurl request.organizer "presale:organizer.index" %}">
                    &laquo; {% blocktrans trimmed with name=request.organizer.name %}
                    Show all events of {{ name }}
                {% endblocktrans %}
                </a>
            </div>
        {% endif %}
        <div class="clearfix"></div>
    </div>
{% endblock %}
{% block page %}
    <div class=" {% if event_logo and event.settings.logo_image_large %}logo-large{% endif %}">
        {% if event.settings.locales|length > 1 %}
            {% if event.settings.theme_color_background|upper == "#FFFFFF" and not event.settings.logo_image_large %}
                <div class="{% if not event_logo or not event.settings.logo_image_large %}pull-right flip{% endif %} loginbox hidden-print">
                    <nav class="locales" aria-label="{% trans "select language" %}">
                        {% for l in languages %}
                            <a href="{% url "presale:locale.set" %}?locale={{ l.code }}&next={{ request.path }}{% if request.META.QUERY_STRING %}%3F{{ request.META.QUERY_STRING|urlencode }}{% endif %}" class="{% if l.code == request.LANGUAGE_CODE %}active{% endif %}" rel="nofollow">
                                {{ l.name_local }}</a>
                        {% endfor %}
                    </nav>
                </div>
            {% endif %}
        {% endif %}
        <div class="clearfix"></div>
    </div>
    {% if request.event.testmode %}
        {% if request.sales_channel.testmode_supported %}
            <div class="alert alert-warning alert-margin">
                <strong>
                    {% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
                </strong>
            </div>
        {% else %}
            <div class="alert alert-danger">
                <strong>
                    {% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
                </strong>
            </div>
        {% endif %}
    {% endif %}
    {% if messages %}
        {% for message in messages %}
            <div class="alert {{ message.tags }}">
                {{ message }}
            </div>
        {% endfor %}
    {% endif %}
    {% if request.event.settings.banner_text %}
        <div class="site-notice-top">
            {{ request.event.settings.banner_text|rich_text }}
        </div>
    {% endif %}
    {% block content %}
    {% endblock %}
{% endblock %}
{% block footer %}
    {% if request.event.settings.banner_text_bottom %}
        <div class="site-notice-bottom">
            {{ request.event.settings.banner_text_bottom|rich_text }}
        </div>
    {% endif %}
    {% if request.event.testmode %}
        {% if request.sales_channel.testmode_supported %}
            <div class="alert alert-testmode alert-warning">
                <strong>
                    {% trans "This ticket shop is currently in test mode. Please do not perform any real purchases as your order might be deleted without notice." %}
                </strong>
            </div>
        {% else %}
            <div class="alert alert-testmode alert-danger">
                <strong>
                    {% trans "Orders made through this sales channel cannot be deleted - even if the ticket shop is in test mode!" %}
                </strong>
            </div>
        {% endif %}
    {% endif %}
{% endblock %}
{% block footernav %}
    {% if request.event.settings.contact_mail %}
        <a href="mailto:{{ request.event.settings.contact_mail }}">{% trans "Contact event organizer" %}</a> &middot;
    {% endif %}
    {% if request.event.settings.imprint_url %}
        <a href="{% safelink request.event.settings.imprint_url %}" target="_blank" rel="noopener">{% trans "Imprint" %}</a>
        &middot;
    {% endif %}
{% endblock %}
